Adjust skb->truesize appropriately in netback driver.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 5 May 2006 12:49:49 +0000 (13:49 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 5 May 2006 12:49:49 +0000 (13:49 +0100)
When you generate non-linear skb's as netback does, it is up to you
to ensure that truesize reflects the size of paged part of the skb.
Otherwise socket memory accounting in Linux falls apart.

Thanks to the new check that David Miller added to TCP we were able
to catch this bug.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
linux-2.6-xen-sparse/drivers/xen/netback/netback.c

index a58e215163d29003e2d428311254a8fc04552587..10ddc8adafe6e01b0bd25f76ec77374a26eddb9f 100644 (file)
@@ -659,6 +659,7 @@ static void net_tx_action(unsigned long unused)
 
                skb->data_len  = txreq.size - data_len;
                skb->len      += skb->data_len;
+               skb->truesize += skb->data_len;
 
                skb->dev      = netif->dev;
                skb->protocol = eth_type_trans(skb, skb->dev);